package string;

public class StartsWithDemo {
    public static void main(String[] args) {
        String line = "www.tedu.cn";
        boolean starts = line.startsWith("www");
        System.out.println(starts); //true
        starts = line.startsWith("WWW");
        System.out.println(starts); //false

        System.out.println("----------------------------");
        boolean ends = line.endsWith(".cn");
        System.out.println(ends); //true
        ends = line.endsWith(".com");
        System.out.println(ends); //false
    }
}
